package com.zr.sms.serviceimpl;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.zr.sms.dao.GoodsListDao;
import com.zr.sms.dao.ShopListDao;
import com.zr.sms.daoimpl.GoodsListDaoImpl;
import com.zr.sms.daoimpl.ShopListDaoImpl;
import com.zr.sms.service.AddService;

public class AddServiceImpl implements AddService{
  ShopListDao sl=new ShopListDaoImpl();
  GoodsListDao gl=new GoodsListDaoImpl();

	public boolean addShopList(String sdate, String scontent,
			double stotalmoney, int eid) {
		// TODO Auto-generated method stub
		return sl.insertShopList(sdate, scontent, stotalmoney, eid);
	}
	@Override
	public JSONObject getShopLists(int start, int pageSize, String searchdate) {
		JSONObject shoplists = new JSONObject();
		shoplists.put("total", sl.getSlConut(searchdate));
		shoplists.put("rows", JSONArray.fromObject(sl.getShopLists(start, pageSize,searchdate)));
		return shoplists;
	}
	@Override
	public JSONObject getShopLists(int start, int pageSize) {
		JSONObject shoplists = new JSONObject();
		shoplists.put("total", sl.getSlsConut());
		shoplists.put("rows", JSONArray.fromObject(sl.getShopLists(start, pageSize)));
		return shoplists;
	}
	@Override
	public boolean addGoodsList(String gdate, String gcontent,
			double gtotalmoney, int eid) {
		// TODO Auto-generated method stub
		return gl.addGoodsList(gdate, gcontent, gtotalmoney, eid);
	}

	
}
